package com.beiding.config;

import feign.codec.Decoder;
import feign.codec.Encoder;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringDecoder;
import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean;

public class CommonFeignConfig {
    @Bean
    public Encoder springEncoder(ObjectFactory<HttpMessageConverters> messageConverters)
    {
       return new SpringEncoder(messageConverters);
    }

    @Bean
    public Decoder springDecoder(ObjectFactory<HttpMessageConverters> messageConverters)
    {
        return new SpringDecoder(messageConverters);
    }

}
